(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
rev1(0, nil) → 0
rev1(s(X), nil) → s(X)
rev1(X, cons(Y, L)) → rev1(Y, L)
rev(nil) → nil
rev(cons(X, L)) → cons(rev1(X, L), rev2(X, L))
rev2(X, nil) → nil
rev2(X, cons(Y, L)) → rev(cons(X, rev(rev2(Y, L))))
Rewrite Strategy: INNERMOST
(1) RenamingProof (EQUIVALENT transformation)
Renamed function symbols to avoid clashes with predefined symbol.
(2) Obligation:
Runtime Complexity Relative TRS:
The TRS R consists of the following rules:
rev1(0', nil) → 0'
rev1(s(X), nil) → s(X)
rev1(X, cons(Y, L)) → rev1(Y, L)
rev(nil) → nil
rev(cons(X, L)) → cons(rev1(X, L), rev2(X, L))
rev2(X, nil) → nil
rev2(X, cons(Y, L)) → rev(cons(X, rev(rev2(Y, L))))
S is empty.
Rewrite Strategy: INNERMOST
(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(4) Obligation:
Innermost TRS:
Rules:
rev1(0', nil) → 0'
rev1(s(X), nil) → s(X)
rev1(X, cons(Y, L)) → rev1(Y, L)
rev(nil) → nil
rev(cons(X, L)) → cons(rev1(X, L), rev2(X, L))
rev2(X, nil) → nil
rev2(X, cons(Y, L)) → rev(cons(X, rev(rev2(Y, L))))
Types:
rev1 :: 0':s → nil:cons → 0':s
0' :: 0':s
nil :: nil:cons
s :: a → 0':s
cons :: 0':s → nil:cons → nil:cons
rev :: nil:cons → nil:cons
rev2 :: 0':s → nil:cons → nil:cons
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
hole_a3_0 :: a
gen_nil:cons4_0 :: Nat → nil:cons
(5) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
rev1,
rev,
rev2They will be analysed ascendingly in the following order:
rev1 < rev
rev = rev2
(6) Obligation:
Innermost TRS:
Rules:
rev1(
0',
nil) →
0'rev1(
s(
X),
nil) →
s(
X)
rev1(
X,
cons(
Y,
L)) →
rev1(
Y,
L)
rev(
nil) →
nilrev(
cons(
X,
L)) →
cons(
rev1(
X,
L),
rev2(
X,
L))
rev2(
X,
nil) →
nilrev2(
X,
cons(
Y,
L)) →
rev(
cons(
X,
rev(
rev2(
Y,
L))))
Types:
rev1 :: 0':s → nil:cons → 0':s
0' :: 0':s
nil :: nil:cons
s :: a → 0':s
cons :: 0':s → nil:cons → nil:cons
rev :: nil:cons → nil:cons
rev2 :: 0':s → nil:cons → nil:cons
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
hole_a3_0 :: a
gen_nil:cons4_0 :: Nat → nil:cons
Generator Equations:
gen_nil:cons4_0(0) ⇔ nil
gen_nil:cons4_0(+(x, 1)) ⇔ cons(0', gen_nil:cons4_0(x))
The following defined symbols remain to be analysed:
rev1, rev, rev2
They will be analysed ascendingly in the following order:
rev1 < rev
rev = rev2
(7) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
rev1(
0',
gen_nil:cons4_0(
n6_0)) →
0', rt ∈ Ω(1 + n6
0)
Induction Base:
rev1(0', gen_nil:cons4_0(0)) →RΩ(1)
0'
Induction Step:
rev1(0', gen_nil:cons4_0(+(n6_0, 1))) →RΩ(1)
rev1(0', gen_nil:cons4_0(n6_0)) →IH
0'
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(8) Complex Obligation (BEST)
(9) Obligation:
Innermost TRS:
Rules:
rev1(
0',
nil) →
0'rev1(
s(
X),
nil) →
s(
X)
rev1(
X,
cons(
Y,
L)) →
rev1(
Y,
L)
rev(
nil) →
nilrev(
cons(
X,
L)) →
cons(
rev1(
X,
L),
rev2(
X,
L))
rev2(
X,
nil) →
nilrev2(
X,
cons(
Y,
L)) →
rev(
cons(
X,
rev(
rev2(
Y,
L))))
Types:
rev1 :: 0':s → nil:cons → 0':s
0' :: 0':s
nil :: nil:cons
s :: a → 0':s
cons :: 0':s → nil:cons → nil:cons
rev :: nil:cons → nil:cons
rev2 :: 0':s → nil:cons → nil:cons
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
hole_a3_0 :: a
gen_nil:cons4_0 :: Nat → nil:cons
Lemmas:
rev1(0', gen_nil:cons4_0(n6_0)) → 0', rt ∈ Ω(1 + n60)
Generator Equations:
gen_nil:cons4_0(0) ⇔ nil
gen_nil:cons4_0(+(x, 1)) ⇔ cons(0', gen_nil:cons4_0(x))
The following defined symbols remain to be analysed:
rev2, rev
They will be analysed ascendingly in the following order:
rev = rev2
(10) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol rev2.
(11) Obligation:
Innermost TRS:
Rules:
rev1(
0',
nil) →
0'rev1(
s(
X),
nil) →
s(
X)
rev1(
X,
cons(
Y,
L)) →
rev1(
Y,
L)
rev(
nil) →
nilrev(
cons(
X,
L)) →
cons(
rev1(
X,
L),
rev2(
X,
L))
rev2(
X,
nil) →
nilrev2(
X,
cons(
Y,
L)) →
rev(
cons(
X,
rev(
rev2(
Y,
L))))
Types:
rev1 :: 0':s → nil:cons → 0':s
0' :: 0':s
nil :: nil:cons
s :: a → 0':s
cons :: 0':s → nil:cons → nil:cons
rev :: nil:cons → nil:cons
rev2 :: 0':s → nil:cons → nil:cons
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
hole_a3_0 :: a
gen_nil:cons4_0 :: Nat → nil:cons
Lemmas:
rev1(0', gen_nil:cons4_0(n6_0)) → 0', rt ∈ Ω(1 + n60)
Generator Equations:
gen_nil:cons4_0(0) ⇔ nil
gen_nil:cons4_0(+(x, 1)) ⇔ cons(0', gen_nil:cons4_0(x))
The following defined symbols remain to be analysed:
rev
They will be analysed ascendingly in the following order:
rev = rev2
(12) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol rev.
(13) Obligation:
Innermost TRS:
Rules:
rev1(
0',
nil) →
0'rev1(
s(
X),
nil) →
s(
X)
rev1(
X,
cons(
Y,
L)) →
rev1(
Y,
L)
rev(
nil) →
nilrev(
cons(
X,
L)) →
cons(
rev1(
X,
L),
rev2(
X,
L))
rev2(
X,
nil) →
nilrev2(
X,
cons(
Y,
L)) →
rev(
cons(
X,
rev(
rev2(
Y,
L))))
Types:
rev1 :: 0':s → nil:cons → 0':s
0' :: 0':s
nil :: nil:cons
s :: a → 0':s
cons :: 0':s → nil:cons → nil:cons
rev :: nil:cons → nil:cons
rev2 :: 0':s → nil:cons → nil:cons
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
hole_a3_0 :: a
gen_nil:cons4_0 :: Nat → nil:cons
Lemmas:
rev1(0', gen_nil:cons4_0(n6_0)) → 0', rt ∈ Ω(1 + n60)
Generator Equations:
gen_nil:cons4_0(0) ⇔ nil
gen_nil:cons4_0(+(x, 1)) ⇔ cons(0', gen_nil:cons4_0(x))
No more defined symbols left to analyse.
(14) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
rev1(0', gen_nil:cons4_0(n6_0)) → 0', rt ∈ Ω(1 + n60)
(15) BOUNDS(n^1, INF)
(16) Obligation:
Innermost TRS:
Rules:
rev1(
0',
nil) →
0'rev1(
s(
X),
nil) →
s(
X)
rev1(
X,
cons(
Y,
L)) →
rev1(
Y,
L)
rev(
nil) →
nilrev(
cons(
X,
L)) →
cons(
rev1(
X,
L),
rev2(
X,
L))
rev2(
X,
nil) →
nilrev2(
X,
cons(
Y,
L)) →
rev(
cons(
X,
rev(
rev2(
Y,
L))))
Types:
rev1 :: 0':s → nil:cons → 0':s
0' :: 0':s
nil :: nil:cons
s :: a → 0':s
cons :: 0':s → nil:cons → nil:cons
rev :: nil:cons → nil:cons
rev2 :: 0':s → nil:cons → nil:cons
hole_0':s1_0 :: 0':s
hole_nil:cons2_0 :: nil:cons
hole_a3_0 :: a
gen_nil:cons4_0 :: Nat → nil:cons
Lemmas:
rev1(0', gen_nil:cons4_0(n6_0)) → 0', rt ∈ Ω(1 + n60)
Generator Equations:
gen_nil:cons4_0(0) ⇔ nil
gen_nil:cons4_0(+(x, 1)) ⇔ cons(0', gen_nil:cons4_0(x))
No more defined symbols left to analyse.
(17) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
rev1(0', gen_nil:cons4_0(n6_0)) → 0', rt ∈ Ω(1 + n60)
(18) BOUNDS(n^1, INF)